using System;
using System.Collections.Generic;
using UMC.Data;
namespace UMC.ITME.Entities
{
    public partial class SiteGroup
    {
        readonly static Action<SiteGroup, object>[] _SetValues = new Action<SiteGroup, object>[] { (r, t) => r.Caption = Reflection.ParseObject(t, r.Caption), (r, t) => r.Icon = Reflection.ParseObject(t, r.Icon), (r, t) => r.Key = Reflection.ParseObject(t, r.Key), (r, t) => r.Seq = Reflection.ParseObject(t, r.Seq), (r, t) => r.Type = Reflection.ParseObject(t, r.Type) };
        readonly static string[] _Columns = new string[] { "Caption", "Icon", "Key", "Seq", "Type" };
        protected override void SetValue(string name, object obv)
        {
            var index = Utility.Search(_Columns, name, StringComparer.CurrentCultureIgnoreCase);
            if (index > -1) _SetValues[index](this, obv);
        }
        protected override void GetValues(Action<String, object> action)
        {
            AppendValue(action, "Caption", this.Caption);
            AppendValue(action, "Icon", this.Icon);
            AppendValue(action, "Key", this.Key);
            AppendValue(action, "Seq", this.Seq);
            AppendValue(action, "Type", this.Type);
        }

        protected override RecordColumn[] GetColumns()
        {
            var cols = new RecordColumn[5];
            cols[0] = RecordColumn.Column("Caption", this.Caption);
            cols[1] = RecordColumn.Column("Icon", this.Icon);
            cols[2] = RecordColumn.Column("Key", this.Key);
            cols[3] = RecordColumn.Column("Seq", this.Seq);
            cols[4] = RecordColumn.Column("Type", this.Type);
            return cols;
        }

    }
}
